package com.xqboss.apps.vo.user;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xqboss.apps.enums.user.WrenchReceiveTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
@ApiModel("用户资产-推荐人贡献记录视图")
public class WrenchReferrerRecordVo {

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("昵称")
    private String nickName;

    @ApiModelProperty("头像地址")
    private String avatar;

    @ApiModelProperty("实名状态 0未实名 1第一次实名 2第二次实名")
    private int authStatus;

    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("贡献扳手数")
    private double wrenchNum;

    @ApiModelProperty("邀请人身份名称")
    private String identityName;

    @ApiModelProperty("类型")
    private WrenchReceiveTypeEnum type;

    @ApiModelProperty("是否是直推")
    private Integer isDirect;

    /**
     * 判断该数据是否是直推
     * @return
     */
    public Integer getIsDirect() {
        if (type != null && type == WrenchReceiveTypeEnum.DIRECT_USE_NFT) {
            isDirect = 1;
        } else {
            isDirect = 0;
        }
        return isDirect;
    }

}